<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sistema de Administraci&oacute;n de Condominios - Mantenimiento de Residentes</title>
<%@include file="include/header.jsp" %>
</head>
<body>
<%@include file="include/menu.jsp" %>

    <%
		
		Persona vo = (Persona)session.getAttribute("user");
		
		if (vo== null){
			RequestDispatcher rd = request.getRequestDispatcher("error.jsp");
			rd.forward(request, response);
			return;
		}
	  %>
<div class="container">
	<div class="hero-unit" align="center">
	    	<h2><strong>Modificar Registro de Residente</strong></h2><br>
	    </div>
	<%@page import="java.util.ArrayList,condominios.modelo.Persona"%>

	
  		<div class="row">		
  		<div class="col-md-5 col-md-offset-4">
  			<%
				Persona c2 = new Persona();
	  			c2 = (Persona) request.getAttribute("PERSONA_CAMBIAR");
				if (c2 != null) {%>
				
			<form method="post" action="ResidenteModificarServlet">
			<div class="table-responsive">
			<table class="table table-striped table-bordered table-condensed">
			

  				<tr class="success" ><th colspan="2">Por favor, ingrese los datos  cambiar del residente</th>
				</tr>
  				<tr>
  					<td>Id Usuario</td><td><input type="text" name="txtIdPersonaC" value="<%=c2.getIdPersona()%>"/></td>
  				</tr>
  				<tr>
  					<td>DNI:</td><td><input type="text" name="txtDNIC" value="<%=c2.getDni()%>"/></td>
  				</tr>	
  				<tr>
  					<td>Nombres:</td><td><input type="text" name="txtNombresC" value="<%=c2.getNombres()%>"/></td>
  				</tr>
  				<tr>
  					<td>Apellido Paterno:</td><td><input type="text" name="txtApellidoPC" value="<%=c2.getApellidoPaterno()%>"/></td>
  				</tr>
  				<tr>
  					<td>Apellido Materno:</td><td><input type="text" name="txtApellidoMC" value="<%=c2.getApellidoMaterno()%>"/></td>
  				</tr>	
  				<tr>
  					<td>Email:</td><td><input type="text" name="txtEmailC" value="<%=c2.getEmail()%>"/></td>
  				</tr>
  				<tr>
  					<td>Perfil:</td><td><select name="ddlPerfil"><%if (c2.getIdPerfil()==2) { %>
					<option value="2">Residente</option>
					<option value="1">Administrador</option>
				</select>
  					<%	
  					}
  					else {
  						%><option value="1">Administrador</option>
  						<option value="2">Residente</option>
  						<%
  					}
  					%>
  					
  					
  					</td>
  				</tr>
  				
  				<!--  <tr>
  					<td>Perfil:</td><td><input type="text" name="txtPerfilC" value="<%=c2.obtenerCadenaPerfil(c2.getIdPerfil())%>"/></td>
  				</tr>	-->
  				
			</table>
		</div>			
			<%
  				}			
  				%>	
  			</div>
  		</div> 			
  			<div class="row">		
  		<div class="col-md-12" align="center">
  		
		  	<button type="submit" class="btn btn-primary" name="modificar"/>Modificar</button>
			<button type="submit" class="btn btn-primary" name="cancelar1"/>Cancelar</button>
			
			</div>
			
			</div>	
  		</form>			
			
			<div class="row">		
  		<div class="col-md-12" align="center">
  		
		    <footer>
        	<p>&copy; Java Tigers 2015</p>
        	</footer>
			
			</div>
			
			</div>
		</div>
		
	
</body>
</html>